package com.ccrfid.rmc6.service.business.patrol;

import com.ccrfid.rmc6.appconfig.exception.pojo.AppException;
import com.ccrfid.rmc6.entity.business.patrol.PatrolLocationOverallEntity;
import com.ccrfid.rmc6.entity.business.patrol.PatrolLocationRecordEntity;
import com.ccrfid.rmc6.entity.business.patrol.PatrolScheduleEntity;
import com.ccrfid.rmc6.pojo.dto.patrol.PatrolCompletionRateDto;
import com.ccrfid.rmc6.pojo.dto.patrol.PatrolCompletionRateMonthlyDto;

import java.sql.Date;
import java.util.List;

public interface PatrolService {
    //获取某段时间内的排班情况
    List<PatrolScheduleEntity> getPatrolScheduleList(Date startDate, Date stopDate);

    //获取某个排班
    PatrolScheduleEntity getPatrolSchedule(Long scheduleId) throws AppException;

    //获取某天某个时段的排班信息
    PatrolScheduleEntity getPatrolSchedule(Date dutyDate, Long timeRangeId) throws AppException;

    //添加一个排班
    PatrolScheduleEntity createPatrolSchedule(PatrolScheduleEntity patrolSchedule) throws AppException;

    //修改一个排班
    PatrolScheduleEntity updatePatrolSchedule(Long scheduleId,
                                              PatrolScheduleEntity patrolSchedule) throws AppException;

    //删除一个排班
    Boolean deletePatrolSchedule(Long scheduleId) throws AppException;

    //获取某个排班下各个巡控区域的统计情况
    List<PatrolLocationOverallEntity> getPatrolScheduleLocationOverall(Long scheduleId);

    //获取某个排班下某个巡控区域的统计详细情况
    List<PatrolLocationRecordEntity> getPatrolScheduleLocationRecordList(Long scheduleId, Long locationId);

    //获取某段时间内每天的巡控达标率
    List<PatrolCompletionRateDto> getPatrolAverageCompletionRate(Date startDate, Date stopDate);

    //获取某段时间内每月的巡控达标率
    List<PatrolCompletionRateMonthlyDto> getPatrolAverageCompletionRateMonthly(Date startDate, Date stopDate);

    //巡控统计
    void doStatisticPatrolSchedules();

    //重新统计
    void redoStatisticPatrolSchedules(Date startDate, Date stopDate);
}
